<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

// api中心
//	Route::rule('v1/pay/code', 'api/v1.Pay/code');
//	Route::rule('v1/pay/query', 'api/v1.Pay/query');
//	Route::rule('v1/notify/:action', 'api/v1.Notify/:action');
Route::rule('api/notify/:controller/:action', 'api.notify.:controller/:action');
Route::rule('api/v1/:controller/:action', 'api.v1.:controller/:action');
Route::rule('api/v3/:controller/:action', 'api.v3.:controller/:action')
    ->allowCrossDomain()
    ->middleware([\app\common\middleware\AllowOriginMiddleware::class, \app\middleware\api\UserLogin::class,\app\common\middleware\UserSafe::class]);
//        ->middleware([\app\common\middleware\AllowOriginMiddleware::class]);;
//	Route::rule('api/v3/:controller/:action', 'api.v3.:controller/:action')->allowCrossDomain()
//        ->middleware([\app\common\middleware\AllowOriginMiddleware::class]);;
Route::rule('api/cloud/:controller/:action', 'api.cloud.:controller/:action');
Route::rule('api/wechat/connect/[:id]', 'api.service.WechatOfficial/index');